#ifndef SPECTRALLINEFRAME_H
#define SPECTRALLINEFRAME_H

#include <QFrame>
#include<QStandardItemModel>
#include<QTableWidgetItem>
#include<QMenu>
#include "elementtableframe.h"

namespace Ui {
class SpectralLineFrame;
}

class SpectralLineFrame : public QFrame
{
    Q_OBJECT
    
public:
    explicit SpectralLineFrame(QWidget *parent = 0,AnalyteDataBase *pAnalyteDataBase=NULL,int type=0);
    ~SpectralLineFrame();

    void LoadData();//update

    int SaveData();
    bool SetFileName(QString fileName);
    QString GetFileName();
    //void contextMenuEvent(QContextMenuEvent *) ;
private:
    Ui::SpectralLineFrame *ui;
    ElementTableFrame *pElementTableFrame;

    AnalyteDataBase *pAnalyteDataBase;
    int type;
    QMenu *pMenu;

    QString fileName;

    QString elementName;
    int tableType;//
    int menuType;//type:0

    void EnableSetPara(bool state);
signals:
    void SIG_ElementChooseChanged(bool,QString);
private slots:
    void ShowElementAttribute(int,QString);
    void OnElementChanged(int,QString);
    void OnCurrentRowChangedBase(QModelIndex);
    void OnCurrentRowChangedMulti(QModelIndex);
    void OnValueChanged();

    void on_tableWidget_EleAttribute_itemChanged(QTableWidgetItem *item);
   // void OnEleAttributeDataChanged(QModelIndex,QModelIndex);
    void on_actionDel_triggered();
    void on_actionAdd_triggered();
    void OnCustomContextMenuRequested(const QPoint &pos);
};

#endif // SPECTRALLINEFRAME_H
